package com.cherrish.demo.algorithm.sort;

/**
 * @author cherrish
 * @time 2019-02-22 14:24
 * @name TestSort
 * @desc:
 */
public class TestSort {
    public static void main(String[] args) {
        int[] arr = {999, 99, 9, 111, 222, 888, 333, 666, 777, 444, 222, 22, 11, 33, 44, 88, 77, 55, 66, 1, 3, 8, 6};
//        ISort isort = new SortBubble();
//        ISort isort = new SortSelection();
//        ISort isort = new SortInsertion();
        ISort isort = new SortHell();

        long start = System.nanoTime();
        isort.sort(arr, arr.length);
        long end = System.nanoTime();
        System.out.println("Time-consuming: " + (end - start) +" ns");
        print(arr, arr.length);
    }

    private static void print(int[] arr, int len){
        for(int i = 0; i < len; i++){
            System.out.print(arr[i] + " ");
        }
        System.out.println();
    }
}
